package com.alibaba.nacos.naming.core.v2.pojo;

import com.google.common.base.Joiner;
import lombok.*;
import lombok.experimental.Accessors;

import java.util.Map;

@NoArgsConstructor
@Setter
@Getter
@Accessors(chain = true)
@EqualsAndHashCode
@ToString
public class InstancePublishInfo {

    private String ip;
    private int port;
    private boolean healthy;
    @EqualsAndHashCode.Exclude
    private String cluster;
    private Map<String, Object> extendDatum;

    private static final Joiner JOINER = Joiner.on(":");

    public String getMetadataId() {
        return JOINER.join(ip, port, cluster);
    }
}
